Machine Learning

alt text

Identifying composers from their music has traditionally been a skill reserved for trained musical ears, yet it now poses an intriguing challenge for machine learning and artificial intelligence. Classical music composers each possess a distinctive style, influenced by factors such as rhythmic structure and pitch which affect the speed and mood (be it joyful, passionate, or dramatic) of a piece. These stylistic elements often mirror the composer's lifestyle or the era they lived in. Our research is focused on uncovering the specific structures in piano compositions that define a composer’s style, thus facilitating automatic composer recognition.

In our research, we utilize MIDI files as inputs for our composer recognition algorithm. The initial step involves extracting features from these MIDI files, with a focus on n-grams, a technique widely used in natural language processing and statistical language modeling. n-grams are sequences of 'n' items, which in our context might be syllables, letters, or words, depending on the specific application. To illustrate, consider the sentence: "The cat sat on the mat and the cat sat on the chair." From this, we can form 3-grams such as "the cat sat", "cat sat on", "sat on the", "on the mat" and so on. Below is a table summarizing the occurrences of each 3-gram extracted from the sentence.

3-grams Occurrences
The cat sat 2
cat sat on 2
sat on the 2
on the mat 1
the mat and 1
mat and the 1
and the cat 1
on the chair 1

We utilize a similar method to create music n-grams that focus on both the melody and bass, considering their pitch variations and rhythmic structures. Initially, preprocessing is carried out on the MIDI files to separate the melody from the bass before constructing the n-grams.

alt text

Here's a simple example of how music n-grams are formed from a piece of the score of the Lebanese National Anthem:

alt text

We employ a cortical algorithm for feature reduction and classification, conducting our experiments on a database compiled from the Humdrum project library. The MIDI files are processed using a MATLAB MIDI toolbox. Our approach has been tested for classifying unknown composers and identifying distinct musical styles, achieving a recognition rate of 94.4% on our custom database of 1,197 pieces. This success was attained using only 0.1% of the 231,542 features generated, emphasizing the efficacy of the feature reduction procedure.

After examining the most significant features that led to the best performance, it was possible to identify five key features as most critical: the occurrence of notes with onset on quarter beats, complete beats, and half beats, along with two n-gram combinations of bass notes. From a musical perspective, these findings suggest that piano composers primarily distinguish their style through the handling of bass notes and rhythmic onsets. While melodies are crucial in defining a composer's style, our results indicate that the arrangement of notes across beats and the development of bass patterns in conjunction with the melody provide deeper insights into a composer’s stylistic signature. This is notable since humans typically focus more on high-pitched melodies than on bass notes, yet composers uniquely define their style through variations in rhythm and bass lines accompanying the same melody. Further analysis through one-to-one composer classification revealed confusion rates varying significantly, from a high of 17.1% between Mozart and Haydn to as low as 0.5% between Vivaldi and Joplin, with Joplin being distinctly recognized due to his unique era of composition. The challenges in distinguishing between Haydn and Mozart, as well as Beethoven and Chopin, underscore the subtle stylistic similarities shared among these composers, corroborating historical accounts of their influences and stylistic overlaps.

References: